#ifndef __LOG_ENTRY_WRITE_H__
#define __LOG_ENTRY_WRITE_H__

#define CLOG_BUF_SIZE 1024
#define CLOG_TAG_SIZE 16

#define MAX_LIST_NODES 1024
#define SHM_NAME    "/clog_shmem"

typedef enum {
	CLOG_UNKNOWN = 0,
	CLOG_VERBOSE,
	CLOG_DEBUG,
	CLOG_INFO,
	CLOG_WARN,
	CLOG_ERROR,
	CLOG_FATAL,
    CLOG_MAX,
} clog_priority_e;

typedef struct {
	int32_t prio;
	int32_t pid;
	int32_t ppid;
	time_t tv_sec;
	long tv_nsec;
	char tag[CLOG_TAG_SIZE];
	size_t message_len;
	char message[CLOG_BUF_SIZE];
} clog_entry_t;

typedef struct clog_node_list_s {
    clog_entry_t entry;
    int32_t next;
} clog_node_list_t;

int32_t clog_write_device_init(clog_entry_t *entry);
int32_t clog_read_entry_from_list(clog_entry_t *entry);
int32_t clog_write_entry_to_list(const clog_entry_t *entry);

#endif /* __LOG_ENTRY_WRITE_H__ */